﻿using AutoMapper;
using Esosi.Register.Base.Dtos;
using Esosi.Register.Hospital.Models;
using System;
using System.Collections.Generic;
using System.Text;

namespace Esosi.Register.Hospital.Profiles
{
    public class HospitalTpiProfile : Profile
    {
        public HospitalTpiProfile()
        {
            CreateMap<RegisterCalcTpiDto, RegisterHospitalTpi>()
                .ForMember(dest => dest.PatientName, opt => opt.MapFrom(src => src.PatientInfoDto.PatientName))
                .ForMember(dest => dest.DeptId, opt => opt.MapFrom(src => src.DeptId))
                .ForMember(dest => dest.CostOfMedicalRecord, opt => opt.MapFrom(src => src.CostOfMedicalRecord))
                .ForMember(dest => dest.CostOfProduction, opt => opt.MapFrom(src => src.CostOfProduction))
                .ForMember(dest => dest.RegisterType, opt => opt.MapFrom(src => src.RegisterType))
                .ForMember(dest => dest.ClinicType, opt => opt.MapFrom(src => src.ClinicType))
                .ForMember(dest => dest.PatientSubTypeId, opt => opt.MapFrom(src => src.PatientInfoDto.PatientSubTypeId))
                .ReverseMap();
        }
    }
}